package com.zheng.damo01.HomeWeark05;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;

public class 验证码 {
    public static void main(String[] args) {
        Random r=new Random();

        ArrayList<String>list=new ArrayList<>();
        for (int j = 0; j < 10; j++) {
            String sum="";
            for (int i = 0; i < 5; i++) {
                int r1=r.nextInt(3);
                if (r1==0){
                    char number=(char)(r.nextInt(24)+(int)'a');
                    sum=sum+number;
                }else if (r1==1){
                    char number=(char)(r.nextInt(24)+(int)'A');
                    sum=sum+number;
                }else {
                    int number=(r.nextInt(9));
                    sum=sum+number;
                }
            }
            list.add(sum);
        }
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println("随机验证码："+iterator.next());
        }


    }
}
